<template>
	<div>
		<el-dialog :title="form.id?'编辑':'新建'" :visible.sync="visible" width="60%">
			<el-form :model="form" label-width="140px" :rules="rules" ref="form">
				<h4 class="font-size16" v-if="!isHistory">基本信息</h4>
				<el-form-item label="题库标题" v-if="!isHistory" prop="name">
					<el-input placeholder="请输入题库标题" v-model="form.name" class="width500"></el-input>
				</el-form-item>
				<el-form-item label="请选择试卷" v-if="isHistory" prop="synchId">
					<el-select placeholder="请选择真题" class="width500" filterable v-model="form.synchId">
						<el-option v-for="(item,index) in historyTableData" :key="index" :label="item.name"
							:value="item.id"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="试卷名称" v-if="isHistory" prop="name">
					<el-input placeholder="请输入试卷名称" v-model="form.name" class="width500"></el-input>
				</el-form-item>
				<div class="row-me flex-wrap">
					<el-form-item label="地区" prop="area">
						<el-cascader :props="sourceProps" v-model="form.area" :options="areaData" placeholder="请选择地区"
							class="width260 margin-right20" @change="historyAreaChange"></el-cascader>
					</el-form-item>
					<el-form-item label="试卷年份" v-if="!isShow">
						<el-date-picker v-model="form.year" type="year" placeholder="请选择" class="margin-right20 width260"
							value-format="yyyy">
						</el-date-picker>
					</el-form-item>
					<el-form-item label="标签管理" v-if="!isShow">
						<el-select v-model="form.labelName" multiple filterable allow-create default-first-option
							placeholder="请选择题目标签" class="width260">
						</el-select>
					</el-form-item>
				</div>
				<el-form-item label="试卷分类" v-if="isShow">
					<el-select placeholder="请选择试卷分类" v-model="form.typeId" class="width260">
						<el-option v-for="(item,index) in examTypeData" :key="index" :label="item.name"
							:value="item.id"></el-option>
					</el-select>
				</el-form-item>
				<h4 class="font-size16" v-if="!isHistory">参数设置</h4>
				<div class="row-me flex-wrap" v-if="isShow">
					<el-form-item label="来源简称">
						<el-input v-model="form.sourceName" class="width200 margin-right20" placeholder="请输入来源简称"></el-input>
					</el-form-item>
					<el-form-item label="简称地区" v-if="!isShow">
						<el-cascader :props="{emitPath: false,value: 'id',label: 'name',checkStrictly: true}"
							v-model="form.abbreviationArea" :options="areaData" placeholder="请选择简称地区"
							class="width200 margin-right20"></el-cascader>
					</el-form-item>
					<el-form-item label="简称年份">
						<el-date-picker type="year" v-model="form.abbreviationYear" placeholder="简称年份" class="width200"
							value-format="yyyy"></el-date-picker>
					</el-form-item>
				</div>
				<template v-if="!isShow">
					<div class="row-me flex-wrap">
						<el-form-item label="虚拟人数">
							<div class="row-me row-center">
								<el-input placeholder="请输入虚拟人数" type="number" v-model="form.virtualPeople"
									class="width200 margin-right20"></el-input>
							</div>
						</el-form-item>
						<el-switch v-model="form.addStatus" class="line-height40"></el-switch>
						<el-form-item label="自增设置" label-width="80px">
							<div class="row-me row-center" v-if="form.addStatus">
								<el-input class="width100" v-model="form.addMin" placeholder="请输入"></el-input>
								<span class="margin-left5 margin-right5">~</span>
								<el-input class="width100" v-model="form.addMax" placeholder="请输入"></el-input>
								<el-select placeholder="请选择" v-model="form.addTime" class="margin-left20">
									<el-option label="每30分钟" :value="1"></el-option>
									<el-option label="每小时" :value="2"></el-option>
									<el-option label="每天" :value="3"></el-option>
								</el-select>
							</div>
						</el-form-item>
					</div>
					<div class="row-me flex-wrap">
						<el-form-item label="排序">
							<el-input placeholder="请输入题库排序" v-model="form.sequence" class="width200 margin-right20"></el-input>
						</el-form-item>
						<el-form-item label="答案序号">
							<el-input placeholder="请输入" v-model="form.answerIndex" class="width200"></el-input>
						</el-form-item>
					</div>
					<el-form-item label="权限设置" prop="buyType">
						<el-radio-group v-model="form.buyType">
							<el-radio :label="1">无权限</el-radio>
							<el-radio :label="2">需分享</el-radio>
							<el-radio :label="3" v-if="!isShow">需授权</el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item label="试卷下载是否开启">
						<el-radio v-model="form.showUrl" :label="false">否</el-radio>
						<el-radio v-model="form.showUrl" :label="true">是</el-radio>
					</el-form-item>
					<el-form-item label="题库文件">
						<div class="row-me">
							<div class="margin-right10">
								<el-radio v-model="form.showGener" :label="false">自动生成</el-radio>
								<el-radio v-model="form.showGener" :label="true">上传文件</el-radio>
							</div>
							<singleUploadLocal :value="fileList" v-if="form.showGener"
								message="支持扩展名: .raz .zip .doc .docx .pdf .jpg..." @input="getFile">
							</singleUploadLocal>
						</div>
					</el-form-item>
					<el-form-item label="试卷描述" v-if="isShow||isHistory">
						<el-input type="textarea" placeholder="请输入试卷描述" v-model="form.description" rows="8"></el-input>
					</el-form-item>
					<el-form-item label="来源设置" v-if="!isShow&&!isHistory">
						<el-switch v-model="form.sourceSet"></el-switch>
						<template v-if="form.sourceSet">
							<el-date-picker type="years" v-model="form.sourceYear" placeholder="来源年份"
								class="margin-right20 margin-left20" value-format="yyyy">
							</el-date-picker>
							<el-cascader :props="sourceProps" v-model="sourceArea" :options="areaData" placeholder="请选择来源地区"
								@change="onSourceChange"></el-cascader>
						</template>
					</el-form-item>
				</template>
			</el-form>
			<span slot="footer">
				<el-button type="primary" @click="saveExamPaper">{{isHistory?'确 认':'下一步'}}</el-button>
				<el-button @click="visible = false">取 消</el-button>
			</span>
		</el-dialog>

		<!-- 选择试题 -->
		<el-dialog title="选择试题" :visible.sync="questionVisible" width="60%" @close="handleOk">
			<div>
				<div class="margin-bottom20 row-me flex-end">
					<el-button type="primary" @click="batchExportQuestion">批量导出</el-button>
				</div>
				<el-card class="margin-bottom20" v-for="(item,index) in coverData" :key="index">
					<div class="row-me row-center">
						<div>
							{{$.numberToChinese(index+1)}}、{{item.title}}({{tableData[index]?tableData[index].length:0}}) <el-button
								type="text" class="margin-left10" @click="clickAddExam(item)">添加试题</el-button>
						</div>
						<div class="flex1"></div>
						<el-button type="text" @click="clickAddType(item)">修改题型</el-button>
						<el-button type="text" @click="clickDelType(item.id)">删除</el-button>
					</div>
					<el-table :data="tableData[index]" ref="multipleTable" border class="margin-top20"
						header-cell-class-name="table-header-style" @selection-change="handleSelectionChange">
						<el-table-column type="expand" width="0">
							<template slot-scope="scope">
								<div style="max-width:50vw;max-height: 500px;overflow-y: scroll;" class="margin-left20"
									v-if="scope.row.type.value==99||scope.row.type.value==114||scope.row.type.value==113||scope.row.type.value==115">
									<div class="color252525 margin-right10">题目：<span v-html="scope.row.title"></span></div>
									<div v-for="(item,index) in scope.row.clozeList" :key="index" class="margin-top30">
										<div class="color252525">
											<div class="row-me">{{index+1}}.<div v-html="item.title"></div>
											</div>
											<div v-if="item.content">
												<div class="margin-top10" v-for="(val,i) in JSON.parse(item.content)" :key="i">
													{{val.title}}.<img class="width100" v-if="judgeImg(val.content)" :src="val.content" alt="">
													<span v-else>{{val.content}}</span>
												</div>
											</div>
										</div>
										<div class="row-me margin-top10">
											<span class="color929397 margin-right10">答案</span>
											<div class="color252525 flex1 line-height21 row-me"><span
													class="colorEE010B font-weight600 margin-right5" v-html="item.answer"></span>
												<div class="row-me">
													<div v-html="item.textExplain"></div>
												</div>
											</div>
										</div>
									</div>
								</div>
								<div style="max-width:50vw;" class="margin-left20" v-else>
									<div class="row-me">
										<span class="color929397 margin-right10">题目</span>
										<div class="flex1 color252525">
											<div v-html="scope.row.title"></div>
											<div v-if="scope.row.type.value!=100&&scope.row.content">
												<div class="margin-top10" v-for="(item,index) in JSON.parse(scope.row.content)" :key="index">
													{{item.title}}.<img class="width100" v-if="judgeImg(item.content)" :src="item.content" alt="">
													<span v-else v-html="item.content"></span>
												</div>
											</div>
										</div>
									</div>
									<div class="row-me margin-top10" style="max-height: 500px;overflow-y: auto;"
										v-if="scope.row.type.value==100">
										<span class="color929397 margin-right10">答案</span>
										<div class="flex1">
											<div v-for="(item,index) in scope.row.clozeList" :key="index"
												class="color252525 flex1 line-height21 margin-bottom10">
												<div v-if="item.content">
													<div v-for="(val,i) in JSON.parse(item.content)" :key="i">
														{{val.title||''}}、{{val.content||''}}
													</div>
												</div>
												<div class="row-me">
													<span class="colorEE010B font-weight600 margin-right5">{{item.answer}}</span>
													<div class="row-me">
														<div v-html="item.textExplain"></div>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div class="row-me margin-top10" v-else>
										<span class="color929397 margin-right10">答案</span>
										<div class="color252525 flex1 line-height21 row-me"><span
												class="colorEE010B font-weight600 margin-right5" v-html="scope.row.answer"></span>
											<div class="row-me">
												<div v-html="scope.row.textExplain"></div>
											</div>
										</div>
									</div>
								</div>
								<p class="margin-left20">
									<b>正确率：{{item.accurate||0}}%</b>
								</p>
							</template>
						</el-table-column>
						<el-table-column type="selection" width="55" align="center"></el-table-column>
						<el-table-column type="index" width="80" align="center" label="题目序号"></el-table-column>
						<el-table-column label="题型" prop="type.name" align="center" width="100"></el-table-column>
						<el-table-column label="题目" prop="title">
							<template slot-scope="scope">
								<div v-html="scope.row.title" class="line2"></div>
							</template>
						</el-table-column>
						<el-table-column label="标签" prop="title">
							<template slot-scope="{row}">
								<div v-if="row.lableNames&&row.lableNames.length!=0">
									{{Array.from(row.lableNames,({name})=>name).toString()}}
								</div>
							</template>
						</el-table-column>
						<el-table-column label="操作" align="center" width="200">
							<template slot-scope="scope">
								<el-button type="text" @click="moveUp(scope.row)">上移</el-button>
								<el-button type="text" class="margin-right10" @click="moveDown(scope.row)">下移</el-button>
								<el-popconfirm title="确定删除吗？" @confirm="handleDel(scope.row.id,item.id)">
									<el-button type="text" slot="reference">删除</el-button>
								</el-popconfirm>
							</template>
						</el-table-column>
					</el-table>
					<div class="margin-top10">
						<el-pagination background layout="->,total, prev, pager, next" :current-page="query['pageNumber'+index]"
							:page-size="query.pageSize" :total="query['total'+index]"
							@current-change="(val)=>handlePageChange(val,index,item)"></el-pagination>
					</div>
				</el-card>
				<el-button type="primary" @click="clickAddType">添加题型</el-button>
			</div>
			<span slot="footer">
				<el-button type="primary" @click="[questionVisible = false,visible=true]" v-if="!isDetail">上一步</el-button>
				<el-button @click="handleOk" type="primary" v-if="!isDetail">确 认</el-button>
				<el-button type="primary" @click="questionVisible=false" v-if="isDetail">关 闭</el-button>
			</span>
		</el-dialog>

		<!-- 添加修改题型 -->
		<el-dialog :title="title" :visible.sync="typeVisible" width="30%">
			<el-form :model="typeForm" label-width="80px">
				<el-form-item label="题型名称">
					<el-input v-model="typeForm.title" placeholder="请输入题型名称" class="width100Per"></el-input>
				</el-form-item>
				<el-form-item label="单题分值">
					<el-input v-model="typeForm.totalScore" placeholder="请输入单题分值" class="width100Per"></el-input>
				</el-form-item>
				<el-form-item label="题型描述">
					<el-input v-model="typeForm.desc" type="textarea" placeholder="请输入题型描述" rows="6"
						class="width100Per"></el-input>
				</el-form-item>
			</el-form>
			<span slot="footer">
				<el-button @click="handleTypeSave" type="primary">确 定</el-button>
			</span>
		</el-dialog>

		<!-- 添加试题 -->
		<el-dialog title="添加试题" :visible.sync="addVisible" width="60%">
			<questionBank page="famousQuestion" :examPaperId="query.examPaperId" :examPaperTypeId="query.examPaperTypeId"
				:examPaperScore="query.totalScore" @handleExamOk="handleExamOk"></questionBank>
		</el-dialog>

		<batchExport ref="batchExport"></batchExport>
	</div>
</template>

<script>
	import singleUploadLocal from "@/components/Upload/singleUploadLocal"
	import questionBank from "@/components/questionBank"
	import batchExport from "@/components/batchExport"
	export default {
		name: 'famousQuestion',
		components: {
			singleUploadLocal,
			questionBank,
			batchExport
		},
		data() {
			const validateOrg = (rule, value, callback) => {
				if (!this.form.area || !this.form.area.length) {
					callback(new Error('请选择地区'))
				} else {
					callback()
				}
			}
			return {
				form: {},
				visible: false,
				tagList: [],
				questionVisible: false,
				tableData: [],
				multipleSelection: [],
				title: '',
				typeForm: {},
				typeVisible: false,
				addVisible: false,
				areaData: [],
				props: {
					value: 'id',
					label: 'name',
					checkStrictly: true,
				},
				sourceProps: {
					value: 'id',
					label: 'name',
					checkStrictly: true,
					multiple: true
				},
				query: {
					pageNumber: 1,
					pageSize: 30
				},
				pageTotal: 0,
				sourceArea: [],
				fileList: [],
				coverData: [],
				examTypeData: [],
				isShow: false, //题库历年真题
				isDetail: 0,
				imgTypeList: ['.jpg', '.jpeg', '.png', '.svg'],
				page: '',
				isHistory: false, //总后台历年真题
				historyTableData: [],
				historyQuery: {
					pageNumber: 1,
					pageSize: 99999
				},
				rules: {
					name: {
						required: true,
						message: '请输入',
						trigger: 'blur'
					},
					synchId: {
						required: true,
						message: '请选择试卷',
						trigger: 'change'
					},
					area: {
						type: 'array',
						required: true,
						validator: validateOrg
					},
					buyType: {
						required: true,
						message: '请设置权限',
						trigger: 'change'
					}
				},
				tableDataCopy: []
			}
		},
		mounted() {
			this.getTagList()
			this.getAllArea()
			this.getExamTypeData()
			this.getHistoryData()
		},
		methods: {
			historyAreaChange(val) {
				this.form.province = []
				this.form.city = []
				this.form.cityShow = []
				if (val.length != 0) {
					for (let item of val) {
						if (item[0]) {
							this.form.province.push(item[0])
						}
						if (item[1]) {
							this.form.city.push(item[1])
						}
					}
				}
				this.form.province = [...new Set(this.form.province)].toString()
				this.form.city = [...new Set(this.form.city)].toString()
				this.form.cityShow = JSON.stringify(val)
				this.$forceUpdate()
			},
			//获取试卷
			async getHistoryData() {
				const res = await this.$post('/admin/examPaper/pageExamPaper?' + this.$.getParamsString(this.historyQuery), {
					roleType: 2,
					status: 2
				})
				if (res.code == 1000) {
					this.historyTableData = res.data.list
				}
			},
			judgeImg(content) {
				let type = ['.jpg', '.png', '.jpeg', '.svg']
				for (let item of type) {
					if (content.indexOf(item) != -1) {
						return true
					}
				}
				return false
			},
			//批量导出试题
			batchExportQuestion() {
				let arr = []
				for (let val of this.tableDataCopy) {
					for (let item of val) {
						arr.push(item)
					}
				}
				this.$refs.batchExport.show(1, arr)
			},
			handleOk() {
				this.questionVisible = false
				this.$emit('handleOk')
			},
			//获取试卷分类下拉
			async getExamTypeData() {
				const res = await this.$postForm('/admin/examPaper/exampaperTypeAll', {
					pageNumber: 1,
					pageSize: 9999
				})
				if (res.code == 1000) {
					this.examTypeData = res.data.list
				}
			},
			//添加试题
			clickAddExam(item) {
				this.addVisible = true
				this.query.examPaperTypeId = item.id
				this.query.totalScore = item.totalScore
			},
			//获取扉页
			async getCoverPage() {
				const res = await this.$get('/admin/examPaper/getCoverPage', {
					examId: this.query.examPaperId
				})
				if (res.code == 1000) {
					this.coverData = res.data
					for (let index in this.coverData) {
						this.getData(this.coverData[index].id, index)
						this.getDataCopy(this.coverData[index].id, index)
					}
				}
			},
			handleExamOk() {
				for (let index in this.coverData) {
					this.getData(this.coverData[index].id, index)
				}
				this.addVisible = false
			},
			//添加题型
			async handleTypeSave() {
				this.typeForm.examPaperId = this.query.examPaperId
				const res = await this.$post('/admin/examPaper/saveCoverPage', this.typeForm)
				if (res.code == 1000) {
					this.$message.success('操作成功')
					this.typeVisible = false
					this.getCoverPage()
				}
			},
			handlePageChange(val, index, row) {
				this.query['pageNumber' + index] = val
				this.getData(row.id, index)
			},
			async getData(id, index) {
				this.query.examPaperTypeId = id
				this.query.roleType = 1
				this.query.pageSize = 10
				let str = 'pageNumber' + index
				const res = await this.$get('/admin/examPaper/getQuestionsByExamPaperId', {
					...this.query,
					pageNumber: this.query[str] || 1
				})
				if (res.code == 1000) {
					this.$set(this.tableData, index, res.data.list)
					this.$set(this.query, ('total' + index), res.data.totalRow)
				}
			},
			async getDataCopy(id, index) {
				let query = {
					...this.query,
					examPaperTypeId: id,
					roleType: 1,
					pageSize: 999999
				}
				const res = await this.$get('/admin/examPaper/getQuestionsByExamPaperId', query)
				if (res.code == 1000) {
					this.$set(this.tableDataCopy, index, res.data.list)
				}
			},
			//下一步
			saveExamPaper() {
				this.$refs['form'].validate(async (valid) => {
					if (valid) {
						this.form.roletype = this.query.roletype
						this.form.labelName = this.form.labelName ? this.form.labelName.toString() : ''
						this.form.sourceSheng = this.form.sourceSheng ? this.form.sourceSheng.toString() : ''
						this.form.sourceShi = this.form.sourceShi ? this.form.sourceShi.toString() : ''
						this.form.sourceXian = this.form.sourceXian ? this.form.sourceXian.toString() : ''
						this.form.sourceYear = this.form.sourceYear ? this.form.sourceYear.toString() : ''
						this.form.addStatus = this.form.addStatus ? 1 : 0
						this.form.sourceSet = this.form.sourceSet ? 1 : 0
						if (this.page == 'famousQuestion') {
							this.form.type = 2
						} else {
							this.form.type = 0
						}
						this.form.roleType = this.isShow ? 2 : 1
						let url = '/admin/examPaper/saveExamPaper'
						if (this.form.id) {
							url = '/admin/examPaper/updateExamPaper'
						}
						if (this.isHistory) {
							url = '/admin/examPaper/synchronizationExamPaper'
						}
						const res = await this.$post(url, this.form)
						if (res.code == 1000) {
							this.visible = false
							if (!this.isHistory) {
								this.query.examPaperId = res.data
								this.getCoverPage()
								this.questionVisible = true
							} else {
								this.$message.success('操作成功')
							}
						}
						this.$emit('handleOk')
					} else {
						console.log('error submit!!');
						return false;
					}
				});
			},
			//来源地区变动
			onSourceChange(val) {
				this.form.sourceSheng = []
				this.form.sourceShi = []
				this.form.sourceXian = []
				if (val.length != 0) {
					for (let item of val) {
						if (item[0]) {
							this.form.sourceSheng.push(item[0])
						}
						if (item[1]) {
							this.form.sourceShi.push(item[1])
						}
						if (item[2]) {
							this.form.sourceXian.push(item[2])
						}
					}
				}
				this.form.sourceSheng = [...new Set(this.form.sourceSheng)]
				this.form.sourceShi = [...new Set(this.form.sourceShi)]
				this.form.sourceXian = [...new Set(this.form.sourceXian)]
			},
			onChange(val) {
				this.$forceUpdate()
				this.form.city = ''
				this.form.province = ''
				if (val.length != 0) {
					this.form.city = val[1]
					this.form.province = val[0]
				}
			},
			//获取省市区树
			async getAllArea() {
				const res = await this.$get('/admin/area/getAllArea')
				if (res.code == 1000) {
					this.areaData = this.$.getTreeData(res.data)
					this.areaData.unshift({
						adcode: '0',
						name: '默认',
						parentId: 0,
						id: '0'
					})
				}
			},
			show(page, row = {}, isDetail = 0) {
				this.page = page
				let roleType = localStorage.getItem('roleType')
				this.isShow = false
				this.isHistory = false
				this.isDetail = isDetail
				this.query.examPaperId = ''
				if (roleType == 3 && page == 'historicalQuestion') {
					if (isDetail == 1) {
						this.query.examPaperId = row.id
						this.getCoverPage()
					}
					this.isShow = true
				} else if (page == 'historicalQuestion') {
					this.isHistory = true
				}
				this.query.roleType = roleType == 3 ? 2 : ''
				if (row.id) {
					this.form = JSON.parse(JSON.stringify(row))
					this.form.addStatus = this.form.addStatus ? true : false
					this.form.sourceSet = this.form.sourceSet ? true : false
					this.form.abbreviationArea = this.form.abbreviationArea ? parseInt(this.form.abbreviationArea) : this.form
						.abbreviationArea
					this.form.area = this.form.cityShow ? JSON.parse(this.form.cityShow) : []
					if (!Array.isArray(this.form.labelName) && this.form.labelName) {
						this.form.labelName = this.form.labelName.split(",")
					}
					if (this.form.questionWord) {
						this.form.showGener = true
						this.fileList = [{
							name: this.form.questionWord,
							url: this.form.questionWord
						}]
					}
				} else {
					this.form = {
						showGener: false
					}
					this.fileList = []
				}
				if (isDetail == 1) {
					this.questionVisible = true
				} else {
					this.visible = true
				}

			},
			//批量删除
			handleBatchDel() {
				this.$confirm('确定要批量删除已选中试题吗？', '提示', {
					type: 'warning'
				}).then(() => {

				}).catch(() => {})
			},
			//删除
			async handleDel(id, examPaperTypeId) {
				const res = await this.$post('/admin/examPaper/removeQuestions?examPaperId=' + this.query
					.examPaperId + '&examPaperTypeId=' + examPaperTypeId, [id])
				if (res.code == 1000) {
					this.$message.success('删除成功')
					for (let index in this.coverData) {
						this.getData(this.coverData[index].id, index)
					}
				}
			},
			//上移
			async moveUp(row) {
				const res = await this.$get('/admin/examPaper/moveUpQuestion', {
					examPaperId: this.query.examPaperId,
					questionId: row.id
				})
				if (res.code == 1000) {
					this.$message.success('上移成功')
					this.getCoverPage()
				}
			},
			//下移
			async moveDown(row) {
				const res = await this.$get('/admin/examPaper/moveDownQuestion', {
					examPaperId: this.query.examPaperId,
					questionId: row.id
				})
				if (res.code == 1000) {
					this.$message.success('下移成功')
					this.getCoverPage()
				}
			},
			//添加修改题型
			clickAddType(row) {
				if (row.id) {
					this.title = '修改题型'
					this.typeForm = JSON.parse(JSON.stringify(row))
				} else {
					this.title = '添加题型'
					this.typeForm = {}
				}
				this.typeVisible = true
			},
			//删除题型
			async clickDelType(id) {
				const res = await this.$postForm('/admin/examPaper/deletedExamType', {
					id
				})
				if (res.code == 1000) {
					this.$message.success('删除成功')
					this.getCoverPage()
				}
			},
			//多选操作
			handleSelectionChange(val) {
				this.multipleSelection = val
			},
			//获取文件
			getFile(data) {
				if (data && data.length != 0) {
					this.form.questionWord = data[data.length - 1]
				}
			},
			//获取标签下拉
			async getTagList() {
				const res = await this.$post('/admin/label/labelList')
				if (res.code == 1000) {
					this.tagList = res.data.list
				}
			},
		}
	}
</script>

<style>
</style>